package ddemo.dao;


import ddemo.pojo.Ask;
import ddemo.pojo.Charger;
import ddemo.pojo.Interface;
import ddemo.pojo.User;

import java.util.List;

//方法接口类
public interface UserMapper {
   //select为对应的注释语句



    @Select("SELECT * FROM `user` WHERE username = #{username} and password = #{password}")
    public User getUser(@Param("username") String username, @Param("password") String password);

   @Select("SELECT * from `user` WHERE username = #{username}")
    public User checkUser(@Param("username") String username);

    @Select("INSERT INTO `user` (username,password,power,ev,phone_number) VALUES (#{username}, #{password}, #{power}, #{ev},#{phone_number})")
    public int insertUser(@Param("username") String username, @Param("password") String password, @Param("power") Integer power, @Param("ev") String ev,@Param("phone_number") String phone_number);
//
    @Select("UPDATE USER SET `ev` = #{ev} WHERE id = #{id}")
    public int evResiter(@Param("ev") String ev,@Param("id") Integer id);











    //
//    @Select("DELETE FROM `user` WHERE id = #{id}")
//    public int deleteUserById(@Param("id") Integer id);
//
//    @Select("SELECT * FROM `user` group by age ASC")
//    public List<User> getAllUser();

}



